package com.ldwx.center.dao;

import com.ldwx.center.model.Recruit;
import com.ldwx.center.model.vo.RecruitCompanyVo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 招聘信息
 */
public interface RecruitDao extends JpaRepository<Recruit, Integer>, JpaSpecificationExecutor<Recruit> {
    @Query("select new com.ldwx.center.model.vo.RecruitCompanyVo(r,c,j) from Recruit r left join Company c on r.companyId = c.id left join Job j on r.jobId = j.id")
    List<RecruitCompanyVo> getAll();

}
